import axios from 'axios'
import { ElMessage } from 'element-plus';
const baseURL = "/api";
const instance = axios.create({baseURL});
instance.interceptors.response.use((res)=>{
    res = res.data;
    if(res.code===0){
        return res;
    }
    else{
        ElMessage.error("后台有错误")
    }
},(err)=>{
    ElMessage.error(err.message?err.message:'后台错误')
}
)

export default instance;